//
//  FileManagerViewController.m
//  PhotographyStudi
//
//  Created by 叶一枫 on 2017/6/5.
//  Copyright © 2017年 叶一枫. All rights reserved.
//

#import "FileManagerViewController.h"

@interface FileManagerViewController ()<UITableViewDelegate,UITableViewDataSource>
@property (weak, nonatomic) IBOutlet UITableView *tableView;


@end

@implementation FileManagerViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    self.tableView.tableFooterView = [[BaseView alloc]init];
    
    [[BSManager defaulBSManager]creatDirectory:@"我的文件" directory:Tmp];
    [[BSManager defaulBSManager]creatFile:@"我的文件/tmp.txt" directory:Tmp];
    
    NSLog(@"%@",[[BSManager defaulBSManager]getFiles:@"" directory:Tmp onlyDirectory:NO]);
}

-(NSInteger)numberOfSectionsInTableView:(UITableView *)tableView{
    return 1;
}

-(NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section{

    return 5;
}

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath{

    BaseTableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:@"fileCell"];
    if (!cell) {
        cell = [[BaseTableViewCell alloc]initWithStyle:UITableViewCellStyleValue1 reuseIdentifier:@"fileCell" UIType:DETAILTIMECELL];
    }
    
    cell.itemImageView.image = [UIImage imageNamed:[[BSManager defaulBSManager]getPlaceholderImageNameWithFiletype:@"txt"]];

    cell.refreshUI = ^(UIImageView *itemImageView, UILabel *itemLabel, UILabel *detailLaebl, UILabel *timeLaebl) {
        itemImageView.frame = CGRectMake(5, 5, cell.frame.size.height - 10, cell.frame.size.height - 10);
    };
    
    cell.itemLabel.text = @"hhahaha";
    cell.detailLaebl.text = @"ruguoyuijianni";
    cell.timeLaebl.text = @"2016.01.03";
    
    return cell;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
